<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>部门调动</title>
<link href="<%=basePath%>css/bootstrap.min.css" rel="stylesheet" >
</head>
<body>
	<!-- 导航 -->
    <nav class="navbar navbar-default ">
      <div class="container">

        <!-- 小屏幕按钮和logo -->
        <div class="navbar-header">
          <button class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a href="#" class="navbar-brand">RM admin</a>
        </div>

        <!-- 小屏幕按钮和logo -->
        <!-- 导航 -->
        <div class="collapse navbar-collapse">
           <ul class=" nav navbar-nav ">
             <li class="active"><a href="#"><span class="glyphicon glyphicon-home"></span> &nbsp;后台首页</a></li>
             <li class="dropdown">
                <a href="organization.html" class="dropdown-toggle" data-toggle="dropdown">
                    组织结构管理
                    <b class="caret"></b>
                </a>
                <ul class="dropdown-menu">
                    <li><a href="${pageContext.request.contextPath }/organization/department">部门管理</a></li>
                    <li><a href="${pageContext.request.contextPath }/organization/job">岗位管理</a></li>

                </ul>
            </li>
            <li class="dropdown">
                <a href="organization.html" class="dropdown-toggle" data-toggle="dropdown">
                    人事信息管理
                    <b class="caret"></b>
                </a>
                <ul class="dropdown-menu">
                    <li><a href="${pageContext.request.contextPath }/employee/enterAddEmployee">员工入职管理</a></li>
                    <li><a href="${pageContext.request.contextPath }/period/enterPeriod/">试用期管理</a></li>
                    <li><a href="${pageContext.request.contextPath }/dept/out">部门调动管理</a></li>
                    <li><a href="${pageContext.request.contextPath }/post/out">岗位调动管理</a></li>
                    <li><a href="${pageContext.request.contextPath }/leave/out">员工离职管理</a></li>

                </ul>
            </li>
             <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                    员工信息中心
                    <b class="caret"></b>
                </a>
                <ul class="dropdown-menu">
                    <li><a href="${pageContext.request.contextPath }/infoemployee/list">员工信息中心</a></li>


                </ul>
            </li>
            <li class="dropdown">
                <a href="organization.html" class="dropdown-toggle" data-toggle="dropdown">
                    报表管理
                    <b class="caret"></b>
                </a>
                <ul class="dropdown-menu">
                    <li><a href="${pageContext.request.contextPath }/statement/newHire">新聘员工报表</a></li>
                    <li><a href="${pageContext.request.contextPath }/statement/departure">离职员工报表</a></li>
                    <li><a href="${pageContext.request.contextPath }/statement/deptTurn">部门调动员工报表</a></li>
                    <li><a href="${pageContext.request.contextPath }/statement/postTurn">岗位调动员工报表</a></li>
                </ul>
            </li>
           </ul>
           <ul class=" nav navbar-nav navbar-right ">
             <li class="dropdown">
                <a href="#" class=" dropdown-toggle" id="dropdownMenu1" data-toggle="dropdown">admin
                    <span class="caret"></span>
                </a>
            </li>

             <li><a href="http://localhost:8080/PMsystem/admin/exit"><span class="glyphicon glyphicon-off"></span>&nbsp;退出</a></li>
           </ul>
        </div>
        <!-- 导航 -->
      </div>
    </nav>
    <!-- 导航 -->

    <!-- 部门调动开始 -->
   <div class="container-fluid">
       <div class="row">
           <div class="col-md-2">
               <div class="panel-group" id="accordion">
                   <div class="panel panel-default">
                      <div class="panel-heading">
                          <h4 class="panel-title">
                              <a data-toggle="collapse" data-parent="#accordion"
                              href="#collapseThree" style="text-decoration: none;">
                            查询员工列表
                              </a>
                          </h4>
                      </div>
                      <div id="collapseThree" class="panel-collapse collapse in">
                          <div class="panel-body">
                              <table class="table table-hover">
                              <tbody>
                                <tr>
                                  <td style="border:none;"><a href="${pageContext.request.contextPath }/dept/out" style="text-decoration: none;">部门调动</a></td>
                                </tr>


                              </tbody>
                            </table>
                          </div>
                      </div>
                  </div>

                  <div class="panel panel-default">
                      <div class="panel-heading">
                          <h4 class="panel-title">
                              <a data-toggle="collapse" data-parent="#accordion"
                              href="#collapseThreeo" style="text-decoration: none;">
                            已调动部门员工查询
                              </a>
                          </h4>
                      </div>
                      <div id="collapseThreeo" class="panel-collapse collapse in">
                          <div class="panel-body">
                              <table class="table table-hover">
                              <tbody>
                                <tr>
                                  <td style="border:none;"><a href="${pageContext.request.contextPath }/dept/getDeptTranfer" style="text-decoration: none;">已调动部门员工查询</a></td>
                                </tr>
                              </tbody>
                            </table>
                          </div>
                      </div>
                  </div>

              </div>
           </div>

           <!-- 主体内容 -->
           <div class="col-sm-10">
           <div class="panel panel-info">
              <div class="panel-heading">
                  <h3 class="panel-title">修改员工部门</h3>
              </div>
              <div class="panel-body">
                   <form class="bs-example bs-example-form" role="form" action="${pageContext.request.contextPath }/dept/updateAndAdd" method="POST" onsubmit="return check();"> 
                        
                        <div class="input-group">
                            <span class="input-group-addon">员工编号</span>
                            <input type="text" class="form-control" readonly="readonly"name="dt_emp_id" value="${employees.emp_id}">
                        </div>
                        <br>
                        <div class="input-group">
                            <span class="input-group-addon">先前部门</span>
                            <input type="text" class="form-control" readonly="readonly" name="dt_dept_f" value="${employees.department.dept_name}">
                        </div>
                        <br>
                        
                        <div class="input-group">
                            <span class="input-group-addon">调转部门</span>
                            <select class="form-control" data-toggle="tooltip"
        data-placement="top" title="必填选项" name="dt_dept_a">
                              <c:forEach items="${departments }" var="departments">
		                        <option value="${departments.dept_id }">${departments.dept_name }</option>
		                      </c:forEach>
                            </select>
                        </div>
                        
                        <br>
                        <div class="input-group">
                            <span class="input-group-addon" >调转方式</span>
                            <select class="form-control" data-toggle="tooltip"
        data-placement="top" title="必填选项" name="dt_type">
                              <option>主动调动</option>
                              <option>被动调动</option>
                              <option>数据录入错误</option>
                            </select>
                        </div>
                        <br>
                        <div class="input-group">
                            <span class="input-group-addon">调转原因</span>
                            <input type="text" class="form-control" data-toggle="tooltip"
        data-placement="top" title="必填选项" name="dt_reason" id="reason">
                        </div>
                        <br>
                        <div class=" form-group">
                            <label for="name" style="
                                  padding: 6px 12px;
                                  font-size: 14px;
                                  font-weight: 400;
                                  line-height: 1;
                                  color: #555;
                                  text-align: center;
                                  background-color: #eee;
                                  border: 1px solid #ccc;
                                  border-radius: 4px;">调转备注</label>
                            <textarea class="form-control" data-toggle="tooltip"
        data-placement="top" title="选填选项" rows="3" name="dt_remark"></textarea>
                            <!-- <input type="text" class="form-control" data-toggle="tooltip"
        data-placement="top" title="选填选项"> -->
                        </div>

                        <div class="input-group">
                            <span class="input-group-addon">调转日期</span>
                            <input type="date" id="myDay" class="form-control" data-toggle="tooltip"
        data-placement="top" title="必填选项" name="dt_date">
                        </div>
                         <br>
                        <button type="submit" class="btn btn-info">提交</button>

                    </form>
              </div>
          </div>



    </div>
    <!-- 主体内容结束 -->
  </div>
</div>
<!-- 部门调动结束 -->

    <script src="<%=basePath%>js/jquery-3.2.1.min.js"></script>    
    <script src="<%=basePath%>js/bootstrap.min.js"></script>   
    <script type="text/javascript">
		function check(){
		   var reason=document.getElementById("reason").value;		   
		   if(reason==""){
		     alert("不能为空哦！");
		     return false;
		   }	   
		   return true;
		}
		</script> 
		<script>
		if("${success}"=="success"){
			
			alert("调转成功");
			window.location.href="${pageContext.request.contextPath }/dept/out";
		}
		</script>
</body>
</html>